﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HomeLibrary
{
    public partial class ctrlBook : UserControl
    {
        private BookType _book=null;
        public BookType Book{
           // get {return _book;}
            set {_book=value;
            if (_book != null)
            {
                txtTitle.Text = _book.Title;
            }
                       
            }
        }
        public ctrlBook()
        {
            InitializeComponent();
        }

        private void ctrlBook_Load(object sender, EventArgs e)
        {
            if (_book != null)
            {
                txtTitle.Text = _book.Title;
            }
        }
        public void LoadBookData(){
            if (_book != null)
            {
                txtTitle.Text = _book.Title;
            }
        }

        private void txtTitle_TextChanged(object sender, EventArgs e)
        {
            _book.Title = txtTitle.Text;
        }
    }
}
